﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Upload.aspx.cs"
    Inherits="Wicresoft.RDW.Upload.Upload" %>

<%@ Register Src="../UserControls/PagerControl.ascx" TagName="PagerBasicControl"
    TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#<%=btnUpload.ClientID %>").click(checkAllTextValid);
            $("#<%=btnCancel.ClientID %>").click(checkAllTextValid);
            $("#<%=lbtnSubmitEdit.ClientID %>").click(checkAllTextValid);
            $("#<%=lbtnCancelEdit.ClientID %>").click(checkAllTextValid);
        });     
   </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="main_title">
        <h2>
            <%=Resources.NameResource.PerfectPicture_Manage%></h2>
    </div>
    <div class="line_gray">
    </div>
    <br />
    <asp:PlaceHolder ID="phUpload" runat="server" Visible="false">
        <asp:Label ID="lblUploadError" runat="server" ForeColor="Red" />
        <div class="CustomerManagement">
            <table width="100%" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr class="dcTableItem2">
                        <td class="CustomerM">
                            <asp:Label ID="lblUploadPic" runat="server" />
                        </td>
                        <td>
                            &nbsp;<asp:FileUpload ID="Picture" runat="server" Width="95%" />
                        </td>
                    </tr>
                    <tr class="dcTableItem2">
                        <td class="CustomerM">
                            <asp:Label ID="lblDescCN" runat="server" />
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtDescCN" Width="95%" MaxLength="100" />
                            <asp:RequiredFieldValidator ID="rfvtxtDescCN" runat="server" ErrorMessage="*" Display="Dynamic"
                                ForeColor="Red" ControlToValidate="txtDescCN"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr class="dcTableItem2">
                        <td class="CustomerM">
                            <asp:Label ID="lblDescEN" runat="server" />
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtDescEN" Width="95%" MaxLength="100" />
                            <asp:RequiredFieldValidator ID="rfvtxtDescEN" runat="server" ErrorMessage="*" Display="Dynamic"
                                ForeColor="Red" ControlToValidate="txtDescEN"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr class="dcTableItem">
                        <td colspan="2">
                            <div class="sqbtnPane">
                                <p class="sqbtn">
                                    <asp:LinkButton ID="btnUpload" runat="server" OnClick="btnUpload_Click" /></p>
                                <p class="sqbtn">
                                    <asp:LinkButton ID="btnCancel" runat="server" OnClick="btnCancel_Click" CausesValidation="false" /></p>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </asp:PlaceHolder>
    <asp:PlaceHolder ID="phEdit" runat="server" Visible="false">
        <div>
            <div class="CustomerManagement2">
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tbody>
                        <tr class="dcTableItem2">
                            <td class="CustomerM">
                                <asp:Label ID="lblPicture" runat="server" />
                            </td>
                            <td>
                                <img id="imgEdit" src="" alt="" width="160" height="120" runat="server" />
                            </td>
                        </tr>
                        <tr class="dcTableItem2">
                            <td class="CustomerM">
                                <asp:Label ID="lblEditDescCN" runat="server" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="txtEditDescCN" Width="440px" MaxLength="100" />
                                <asp:RequiredFieldValidator ID="rfvtxtEditDescCN" runat="server" ErrorMessage="*"
                                    Display="Dynamic" ForeColor="Red" ControlToValidate="txtEditDescCN"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr class="dcTableItem2">
                            <td class="CustomerM">
                                <asp:Label ID="lblEditDescEN" runat="server" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="txtEditDescEN" Width="440px" MaxLength="100" />
                                <asp:RequiredFieldValidator ID="rfvtxtEditDescEN" runat="server" ErrorMessage="*"
                                    Display="Dynamic" ForeColor="Red" ControlToValidate="txtEditDescEN"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr class="dcTableItem">
                            <td colspan="2">
                                <div class="sqbtnPane">
                                    <p class="sqbtn">
                                        <asp:LinkButton ID="lbtnSubmitEdit" runat="server" OnClick="lbtnSubmitEdit_Click" /></p>
                                    <p class="sqbtn">
                                        <asp:LinkButton ID="lbtnCancelEdit" runat="server" OnClick="btnCancel_Click" CausesValidation="false" /></p>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </asp:PlaceHolder>
    <br />
    <div align="right">
        <asp:Button ID="btnAdd" runat="server" CausesValidation="False" OnClick="btnAdd_Click" />
    </div>
    <div class="HistoryApplicationContent">
        <asp:GridView ID="gvPerfectPicture" runat="server" AutoGenerateColumns="false" Width="100%"
            DataKeyNames="Id" OnRowDataBound="gvPerfectPicture_RowDataBound" OnRowUpdating="gvPerfectPicture_RowUpdating"
            OnRowDeleting="gvPerfectPicture_RowDeleting" HeaderStyle-CssClass="dcTableHeader"
            RowStyle-CssClass="dcTableAlternatingItem" AlternatingRowStyle-CssClass="dcTableItem">
            <Columns>
                <asp:BoundField ItemStyle-Width="6%" />
                <asp:TemplateField ItemStyle-Width="10%">
                    <ItemTemplate>
                        <img src="<%# Eval("Path") %>" alt="" width="80" height="60" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Desc_CN" ItemStyle-Width="25%" />
                <asp:BoundField DataField="Desc_EN" ItemStyle-Width="25%" />
                <asp:TemplateField ItemStyle-Width="10%">
                    <ItemTemplate>
                        <asp:LinkButton class="CommandButton" ID="lbtnUpdate" runat="server" CausesValidation="False"
                            CommandName="Update"></asp:LinkButton>
                        <asp:LinkButton class="CommandButton" ID="lbtnDelete" runat="server" CausesValidation="False"
                            CommandName="Delete"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <table width="100%">
                    <tr class="dcTableHeader">
                        <th width="6%">
                            <%=Resources.NameResource.No%>
                        </th>
                        <th width="10%">
                            <%=Resources.NameResource.PerfectPicture_Pic%>
                        </th>
                        <th width="25%">
                            <%=Resources.NameResource.PerfectPicture_DescCN%>
                        </th>
                        <th width="25%">
                            <%=Resources.NameResource.PerfectPicture_DescEN%>
                        </th>
                        <th width="10%">
                            <%=Resources.ManageResource.mgr_lblAction%>
                        </th>
                    </tr>
                </table>
            </EmptyDataTemplate>
        </asp:GridView>
        <uc:PagerBasicControl ID="pager" runat="server" PageSize="5" />
    </div>
</asp:Content>
